<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>Welcome to CodeIgniter</title>

	<style type="text/css">

	::selection{ background-color: #E13300; color: white; }
	::moz-selection{ background-color: #E13300; color: white; }
	::webkit-selection{ background-color: #E13300; color: white; }

	body {
		background-color: #fff;
		margin: 40px;
		font: 13px/20px normal Helvetica, Arial, sans-serif;
		color: #4F5155;
	}

	a {
		color: #003399;
		background-color: transparent;
		font-weight: normal;
	}

	h1 {
		color: #444;
		background-color: transparent;
		border-bottom: 1px solid #D0D0D0;
		font-size: 19px;
		font-weight: normal;
		margin: 0 0 14px 0;
		padding: 14px 15px 10px 15px;
	}

	code {
		font-family: Consolas, Monaco, Courier New, Courier, monospace;
		font-size: 12px;
		background-color: #f9f9f9;
		border: 1px solid #D0D0D0;
		color: #002166;
		display: block;
		margin: 14px 0 14px 0;
		padding: 12px 10px 12px 10px;
	}

	#body{
		margin: 0 15px 0 15px;
	}
	
	p.footer{
		text-align: right;
		font-size: 11px;
		border-top: 1px solid #D0D0D0;
		line-height: 32px;
		padding: 0 10px 0 10px;
		margin: 20px 0 0 0;
	}
	
	#container{
		margin: 10px;
		border: 1px solid #D0D0D0;
		-webkit-box-shadow: 0 0 8px #D0D0D0;
	}
	</style>
<script type="text/javascript" src="<?php echo base_url();?>js/fcookie/flashcookie.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>js/fcookie/Rookie.js?rookie.swf"></script>
<script type="text/javascript">
function onFlashCookieReady(cookie){
//	cookie.set('test', 'I am not from a "cookie" :) ')
//	alert(cookie.get('test'));
//	cookie.del('test');
//	alert(cookie.get('test'));
//	cookie.clear(); //删除全部cookie
}
Rookie(function(){
	/*
	写入键值示例，第一个参数是键名，第二个参数是键值，键值支持以下多种数据格式：
	Number、String、Array、JSON、Date 
	*/
	this.write("myID","rukey67");//键值为字符串格式
	this.write("rukey",{local:"广州",sex:"male"});//键值为JSON式
	this.write("somedata",[234,534523,234234]);//键值为数组
	this.write("createTime",new Date());//键值为时间格式
	
	/*  读取一个键值，如果过期或者未设置，返回 undefined;
		判断是否有可用数据可以通过以下方式判断：
	    if(this.read("abc")){ some code;  }
	或：if(this.read("abc")==undefined){ some code; }	
	*/
	var r=this.read("myID");	//读取键名为 myID 的数据并赋值给 r
	alert(r);
	this.clear("myID");//删除键名为 netease 的本地数据;
	
	
	/***************华丽分隔线*****************************
	
	写入键值时可以带一个json格式的可选参数，包含两个可选属性:
	crossBrowser：布尔值，是否跨浏览器，缺省值为true允许跨浏览器；
	expire：整型数值，以天为单位的过期时间，缺省值为0，永不过期；
	
	使用示例如下：
	*/
	
	this.write("netease","My company",{crossBrowser:false,expire:30});
	
	/* 调试
		运行此页面，可以在IE9/Firefox/Safari/Opera/Chrome 调试工具的 控制台面板查看调试信息
		ie9      自带工具 developer tools，   按 F12 键启动 
		Firefox  附加组件 firebug，           按 F12 键启动
		opera10  自带工具 dragonfly           按 ctrl+shift+i 启动
		Safari4  自带工具                     按 ctrl+alt+c 启动
		Chrome   自带工具（和Safari的极类似） 按 ctrl+shift+i 启动
	
	
	存储路径：
		Windows 95/98/ME/2000/XP
		c:/Documents and Settings/username/Application Data/Macromedia/Flash 
		Player/#SharedObjects

		Windows Vista/Windows 7:
		c:/Users/username/AppData/Roaming/Macromedia/Flash Player/#SharedObjects

		Macintosh OS X:
		/Users/username/Library/Preferences/Macromedia/Flash 
		Player/#SharedObjects/web_domain/path_to_application/application_name/obje
		ct_name.sol

		Linux/Unix:
		/home/username/.macromedia/Flash_Player/#SharedObjects/web_domain/path_to_
		application/application_name/object_name.sol
		
	Good luck！
	*/
});
</script>
<script type="text/javascript" src="<?php echo base_url();?>js/plug/contentbox/js/plugor.resizable.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>js/Tween.js"></script>
<link rel="stylesheet" href="<?php echo base_url();?>css/base.css" type="text/css">
<link rel="stylesheet" href="<?php echo base_url();?>css/ui.css" type="text/css">
</head>
<body>
<div id="container">
	<h1>Welcome to CodeIgniter!</h1>
	<div id="body">



<div class="ui-dialog" style="top: 166px;  left: 265px; width: 750px;">
   <div class="ui-dialog-top fn-clear">
      <span class="ui-dialog-top-title">Share list: Dialog title</span>
      <a class="ui-dialog-top-close" href="#"><span>close</span></a>
   </div>
   <div class="ui-dialog-content" style="height: 200px; min-height: 109px; width:auto;" >
		<div class="ui-dialog-content-waiting">
			<img src="<?php echo base_url();?>css/images/ajax-loader.gif">
		</div>
      <p>Dialog content goes here.Dialog contDialog content goes here.Dialog cont
      	ent goes here.Dialog content goes here.Dialog content goes here.ent goes here.
      	Dialog content goes here.ent goes here.Dialog content goes here.ent goes here.
      </p>
      <iframe style="width:100%;height:80px;" src="http://baidu.com"></iframe>
   </div>
   <div class="ui-dialog-bottom fn-clear">
		<i class="ui-resizable-handle"></i>
   </div>
</div>



<script>
var h1Arr = [];
function h1Setup() {
	h1Arr = document.getElementsByTagName('h1');
	for ( var h = 0; h < h1Arr.length; h++) {
		var h1 = h1Arr[h], text = h1.firstChild.nodeValue;
		h1.removeChild(h1.firstChild);
		h1.animNodes = [];
		for ( var i = 0; i < text.length; i++) {
			var span = document.createElement('span');
			span.appendChild(document.createTextNode(text.substring(i, i + 1)));
			h1.appendChild(span);
			h1.animNodes[h1.animNodes.length] = span
		}
		h1.animCount = 0;
		h1.animTimer = setInterval('h1Anim(' + h + ')', 50)
	}
};
function h1Anim(h) {
	var h1 = h1Arr[h], c = h1.animCount++, noAnim = 1;
	for ( var i = 0; i < h1.animNodes.length; i++) {
		var s = h1.animNodes[i];
		var frac = Math.max(0, Math.min(1, (c - i) / 10));
		if (s.animDone)
			continue;
		noAnim = 0;
		s.style.color = 'rgb(' + parseInt(255 - 255 * frac) + ','
				+ parseInt(255 - 111 * frac) + ',' + parseInt(255 - 111 * frac)
				+ ')';
		if (frac == 1) {
			s.style.marginLeft = 'auto';
			s.animDone = 1
		} else if (frac > 0)
			s.style.marginLeft = 0.6 * (1 - frac) + 'em'
	}
	if (noAnim)
		clearInterval(h1.animTimer);
	h1.style.visibility = 'visible'
};
window.onload = function(){

	h1Setup();
}
</script>

<script>
//dates = new Array(100000);
//count = 0;
//tid = setInterval(function () { dates[count++] = new Date() }, 1);
//// 点击IE文档区显示结果
//document.onclick = function() {
//  clearInterval(tid);
//  var str = '';
//  for (var i=1; i<count; i++) {
//    str += 'sleeped: ' + (dates[i].valueOf() - dates[i-1].valueOf()) + 'ms<br>';
//  }
//  document.writeln(str);
//}
</script>
<style>
.tttt h1 {
	font: 80%/1.5 "Trebuchet MS",Verdana,sans-serif;
    color: #009999;
    font-size: 200%;
    margin: 0.1em -100px 0.5em -0.8em;
}
</style>
<div class="tttt">
<h1>三件套,四件套,六件套,九件套,十件套</h1> 
</div>








<p>The page you are looking at is being generated dynamically by CodeIgniter.</p>

<p>If you would like to edit this page you'll find it located at:</p>
<code>application/views/welcome_message.php</code>

<p>The corresponding controller for this page is found at:</p>
<code>application/controllers/welcome.php</code>

<p>If you are exploring CodeIgniter for the very first time, you should start by reading the <a href="user_guide/">User Guide</a>.</p>

<!-- 测试 -->
<?php
function my_echo($var='') {
	echo $var,'<br/>';
}
$arr = array(
	'hello',
	42,
	array(1,'two'),
	'apple'
);
$type = array(
	'n' =>'床上用品',
	array('k'=>'材料','t'=>1,'v'=>'纯棉,亚麻,贡缎'),
	array('k'=>'床尺寸','t'=>1,'v'=>'1.2~1.35m,1.5m,1.8m,2.0m'),
	array('k'=>'套件','t'=>1,'v'=>'三件套,四件套,六件套,九件套,十件套')
);
my_echo(count($type));
$string = serialize($type);//序列化
my_echo($string);

$newarr = unserialize($string);//反序列化
print_r($newarr);
my_echo($newarr[1]['k']);

$string = json_encode($arr);//数组转JSON
my_echo($string);

$newarr = json_decode($string);//JSON转数组
print_r($newarr);
?>
<br/>
<?php
//递归测试
$rows = array(
    array(
        'id' => 1,
        'name' => 'dev',
        'parentid' => 0
    ),
    array(
        'id' => 2,
        'name' => 'php',
        'parentid' => 1
    ),
    array(
        'id' => 3,
        'name' => 'smarty',
        'parentid' => 2
    ),
    array(
        'id' => 4,
        'name' => 'life',
        'parentid' => 0
    ),
    array(
        'id' => 5,
        'name' => 'pdo',
        'parentid' => 2
    ),
    array(
        'id' => 6,
        'name' => 'pdo-mysql',
        'parentid' => 5
    ),
    array(
        'id' => 7,
        'name' => 'java',
        'parentid' => 1
    )
);

function findChild(&$arr,$id){
	$childs=array();
	foreach ($arr as $k =>$v){
		if($v['parentid']== $id){
			$childs[]=$v;
		}
	}
	return $childs;
}

function build_tree($rows,$id){
	$childs=findChild($rows,$id);
	if(empty($childs)){
		return null;
	}
	foreach ($childs as $k => $v){
		$rescurTree=build_tree($rows,$v['id']);
		if( null != $rescurTree){
			$childs[$k]['childs']=$rescurTree;
		}
	}
	return $childs;
}
$tree=build_tree($rows,0);
//echo memory_get_usage();
print_r($tree);

$items = explode(':','text:z',2);
echo count($items);
echo '<br/>',$items[0],'<br/>',$items[1],'<br/>';

$aaa = array(1=>'是',0=>'否');
my_echo(json_encode($aaa));
$aaa = '{"1":"是","0":"否"}';
print_r(json_decode($aaa));

echo false == null;
echo 0 == false;
echo '' == false;
echo 0 == '';
?>
<br/>
<?php if(isset($r_message)) echo $r_message;?>
<br/>
<img id="captcha" src="<?php echo site_url('captcha/mixed'),'?',time();?>"/><a href="javascript:refresh();">看不清</a>
<form method="post" action="<?php echo site_url('welcome/test');?>">
	<input type="text" name="captcha"/>
	<input type="submit" value="验证"/>
</form>
<script>
	function refresh(){
		var captcha = document.getElementById('captcha');
		captcha.src = captcha.src.substring(0,captcha.src.indexOf('?')+1)+new Date().getTime(); 
	}
</script>
	</div>
	-------------------------------------------
	<?php echo preg_match("/^([a-z])+$/i", 'aA0a');?>
	-------------------------------------------
	<p class="footer">Page rendered in <strong>{elapsed_time}</strong> seconds</p>
</div>

</body>
</html>